<script type="text/javascript">

function delid(id){
if(confirm("Are you sure you want to delete this identity ?")){
document.location.href="/personas.php?a=del&id="+id;
}
}
</script>


<a href="/add_persona.php">Add an identity</a><br /><br />

<?php

if (mysql_num_rows($check_personas) != 0) {

	?><table style="width:600px; background:#eee" cellpadding="3" cellspacing="2">
		<tr>
			<td style="width:480px;text-align:center"><b>Name</b></td>
			<td style="width:60px;text-align:center"><b>Default</b></td>
			<td style="width:60px;text-align:center"></td>
		</tr><?

	while ($row = mysql_fetch_object($check_personas)) {
		?><tr>
			<td style="background:#fff">&nbsp;&nbsp;<a href="ed_persona.php?id=<?=htmlentities($row->persona_id, ENT_QUOTES, 'UTF-8')?>"><?=htmlentities($row->persona_name, ENT_QUOTES, 'UTF-8')?></a></td>
			<td style="background:#fff;text-align:center"><? if (isset($row->default) && ($row->default == 1)) { ?><b>Yes</b><? } else { ?><a href="personas.php?a=def&id=<?=htmlentities($row->persona_id, ENT_QUOTES, 'UTF-8')?>">No</a><? } ?></td>
			<td style="background:#fff;text-align:center"><a onclick="javascript:delid(<?=htmlentities($row->persona_id, ENT_QUOTES, 'UTF-8')?>);" href="javascript:void(0);">Delete</a></td>
		</tr><?
	}

	?></table><?

} else {
	?>No identities.<?
}

?>
